import { CoolController, BaseController ,CoolUrlTag,TagTypes} from '@cool-midway/core';
import { Body, Get, Inject, Post, Query } from '@midwayjs/core';
import { UserAdEntity } from '../../entity/adInfo';
import { UserAdService } from '../../service/adInfo';

/**
 * 用户-广告播放信息
 */
@CoolUrlTag({
  key: TagTypes.IGNORE_TOKEN,
  value: ['info','list','page'],
})
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: UserAdEntity,
  service: UserAdService,
  insertParam: (ctx => {
    return {
      // 获得当前登录的后台用户ID，需要请求头传Authorization参数
      userId: ctx.user.id
    }
  }),
})
export class AppUserAddressesController extends BaseController {
  @Get('/valid', { summary: '获取用户信息' })
  async valid() {
    return this.ok(JSON.stringify({"isValid": true}) );
  }
}
